<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
*/

$app->get('/', function(){
	echo "welcome to ptime3app api.";
	
	// echo date("Y-m-d H:i:s");
});

$app->get 	('/app/cron', 						'AppController@cron');

$app->get 	('/app', 							'AppController@index');
$app->get 	('/app/{id}', 						'AppController@show');
$app->get   ('/app/{a}/end/{b}/version/newest', 'AppController@versionNewest');
$app->get 	('/app/{a}/end/{b}/init', 			'AppController@init');
$app->get 	('/app/{id}/user', 					'AppController@userIndex');

$app->get  	('/user/{id}/app',  		'UserAppController@index');
$app->post  ('/user/{id}/app/default',  'UserAppController@storeDefault');
$app->post  ('/user/{id}/app/{aid}',  	'UserAppController@store');
$app->put   ('/user/{id}/app/order',  	'UserAppController@updateOrder');
$app->put   ('/user/{id}/app/{aid}',  	'UserAppController@update');
$app->delete('/user/{id}/app/{aid}',  	'UserAppController@destroy');